<template>
	<view class="goods-list-wapper" :class="type">
		<view class="goods-list-item" v-for="(item,index) in list" :key="index" @click="navToDetail(item)">
      <GourmetItem :data="item" v-if="goodsType === 12"></GourmetItem>
      <HotelItem :data="item" v-else-if="goodsType === 13"></HotelItem>
<!--			<view  :goods-data="item">-->
<!--				<goods-item-->
<!--					:info="item"-->
<!--					:tag="tag"-->
<!--					:type="type"-->
<!--					:size="size"-->
<!--					:showSubTitle="showSubTitle"-->
<!--					:showPrice="showPrice"-->
<!--					:showOldPrice="showOldPrice"-->
<!--					:showAction="showAction"-->
<!--				>-->
<!--					<view slot="subTitle"  slot-scope="{text}" >-->
<!--						<slot name="subTitle" :text="text">{{text}}</slot>-->
<!--					</view>-->

<!--					<view slot="action" slot-scope="{text}">-->
<!--						<slot name="action" :text="text">-->
<!--							<button class="payButton" size="mini" @click.stop="handleBtnClick(text)">购买</button>-->
<!--						</slot>-->
<!--					</view>-->
<!--				</goods-item>-->
<!--			</view>-->
		</view>
	</view>
</template>

<script>
	import GoodsItem from './goods-item.vue'
  import GourmetItem from "@/mall_subpages/merchants/item/gourmet.vue";
  import HotelItem from "@/mall_subpages/merchants/item/hotel.vue";
	export default {
		name: 'GoodsList',
		components:{GourmetItem, HotelItem, GoodsItem },
		props: {
      goodsType: {
        type: Number
      },
			tag: {
				type:String
			},
			type: {
				type: String,
				default:"column"
			},
			list: {
				type: Array,
				default: () => {
					return []
				}
			},
			showSubTitle: {
				type: Boolean,
				default: false
			},
			showPrice: {
				type: Boolean,
				default: true
			},
			showOldPrice: {
				type: Boolean,
				default: false
			},
			showAction:{
				type: Boolean,
				default: false
			},
			size: {
				type: String,
				default: 'base'
			}
		},
		data() {
			return {}
		},
		methods: {
			navToDetail(item) {
				this.$emit('navTo',item)
			},
			handleBtnClick(item) {
				this.$emit('btnClick',item)
			}
		},
    mounted() {
      console.log("类型",this.goodsType)
    },
	}
</script>

<style lang="scss" scoped>
	.payButton{
		// background-color: rgb(190,146,105);
		background: #498FFF;
		color: snow;
		font-weight: bold;
	}
	.goods-list-wapper {
		//background-color:#f8f8f8 ;
		// margin-left: 3%;
		display: flex;
		// margin-bottom: 20rpx;
		&.column {
			flex-direction: row;
			flex-wrap: wrap;
			// justify-content: space-around;
			.goods-list-item {
				//background-color:#f8f8f8 ;
				width:45.5%;
				margin-bottom: 30rpx!important;
				// background-color: #e9e9e9;
				// margin-right: 2%;
				margin-left: 3%;
				.goods-item{
					padding: 0!important;
				}
			}
		}
		&.row {
			flex-direction: column;
		}
	}
  .goods-list-item{
    box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
    margin-bottom: 20rpx;
    border-radius: 16rpx;
  }
	
	.goods-list-wapper :last-child{
		border: none;
		// padding-bottom: 10rpx;
		// margin-left: 2%;
	}
	
</style>
